stack: Fix the slide animation if the child has a non-zero allocation position
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 1 Nov 2013 05:51:27 +0000 (01:51 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 1 Nov 2013 05:53:20 +0000 (01:53 -0400)
This can happen if the child has a margin, for instance.

gtk/gtkstack.c

index 5351eb3050989b379f512f282e3cc2ec3e6f92ac..e7cc767cd0fa0758d0bba73cd37d9a44473f7bf9 100644 (file)
@@ -1612,6 +1612,9 @@ gtk_stack_draw_slide (GtkWidget *widget,
           break;
         }
 
+      x += priv->last_visible_surface_allocation.x;
+      y += priv->last_visible_surface_allocation.y;
+
       cairo_save (cr);
       cairo_set_source_surface (cr, priv->last_visible_surface, x, y);
       cairo_paint (cr);